﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<City>>" %>
<%@ Import Namespace="SDT.Model" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<div class="bar_blue" align="center">
    Nhà đất theo tỉnh thành
</div>
<div class="tinrao_cate">
    <% if (Model != null && Model.Count() > 0)
       {
           int count = 0;
           foreach (var c in Model)
           {
               count++;
    %>
            <%if(count<=10){ %>
    <div class="lc-item">
        <a href="">
            <%= c.Name %></a></div>
            <%} %>
    <%}%>
    <div id="OrherCity" style="display: none;">
      <%count = 0;
           foreach (var c in Model)
           {
               count++;
               if (count <= 10)
                   continue;
    %>
    <div class="lc-item">
        <a href="">
            <%= c.Name %></a></div>
    <%}%></div><%
       }%>
</div>
<div style="float: right;" onclick="DisplayOtherCity();">
    <label onmouseout="this.style.textDecoration = 'none'" onmouseover="this.style.textDecoration = 'underline'"
            id="lblViewMore" style="text-decoration: none; color: #0081AF; cursor: pointer;">
            Xem thêm</label>
</div>
<div class="clear">
</div>

<script type="text/javascript">
    function DisplayOtherCity() {
        var lblMore = $("#lblViewMore").html();
        var divOtherCity = $("#OrherCity").attr("style");
        if (divOtherCity == "display: block;") {
            $("#OrherCity").attr("style", "display: none;");
            $("#lblViewMore").html("Xem thêm");
        }
        else {
            $("#OrherCity").attr("style", "display: block;");
            $("#lblViewMore").html("Thu lại");
        }
    }    

</script>

